package Data;

import java.util.*;

import GUI.Options;

public class Classes {
	private static Classes instance = new Classes();
	public static Classes getInstance() {
		return instance;
	}
	protected Classes() {
		classes = new LinkedList();
	}
	
	private LinkedList<Class> classes;
	
	public void addClass(Class c) {
		classes.addLast(c);
	}
	
	public Class getClass(int id) {
		int size = classes.size();
		for (int i = 0; i < size; i++) {
			if (classes.get(i).getID() == id) return new Class(classes.get(i));
		}
		return null;
	}
	
	public void setClass(int id, Class c) {
		int size = classes.size();
		for (int i = 0; i < size; i++) {
			if (classes.get(i).getID() == id) {
				classes.set(i, new Class(c));
				return;
			}
		}
	}
	
	LinkedList<Class> getClasses() {
		return new LinkedList(classes);
	}
	
	public void removeClass(Class c) {
		classes.remove(c);
	}
}
